//
//  YSPageViewController.m
//  YSKitDemo
//
//  Created by MOLBASE on 2018/8/13.
//  Copyright © 2018年 YangShen. All rights reserved.
//

#import "YSPageViewController.h"
#import "YSPageView.h"
#import "UIColor+YSExtension.h"
#import "UIView+YSFrame.h"

@interface YSPageViewController ()

@end

@implementation YSPageViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    //    NSArray *titles = @[@"游戏", @"趣玩", @"娱乐", @"颜值", @"搞笑"];
    NSArray *titles = @[@"游戏", @"趣玩玩", @"游戏+娱乐", @"颜值颜值", @"搞笑", @"游戏游戏游戏", @"趣玩", @"游戏", @"趣玩"];

    NSMutableArray *childVcs = [NSMutableArray array];
    for (NSString *title in titles) {
        UIViewController *vc = [[UIViewController alloc] init];
        vc.view.backgroundColor = [UIColor ys_randomColor];
        [childVcs addObject:vc];
    }

    YSPageStyle *style = [[YSPageStyle alloc] init];
    //    style.isScrollEnable = NO;
    //    style.isFullScreen = YES;
    //    style.isDelayScroll = YES;
    //    style.isShowUnderLine = YES;
    //    style.isUnderLineEqualTitleWidth = YES;
    //    style.titleWidth = 80;

    style.isShowTitleScale = YES;
    style.isShowTitleGradient = YES;
    //    style.titleColorGradientStyle = YSTitleColorGradientStyleFill;
    //    style.isShowTitleCover = YES;
    style.titleSelectedColor = [UIColor orangeColor];
    style.titleNormalColor = [UIColor blackColor];

    YSPageView *pageView = [[YSPageView alloc] initWithFrame:CGRectMake(0, 64, self.view.ys_width, self.view.ys_height - 64) titles:titles childVcs:childVcs parentVc:self style:style];
    [self.view addSubview:pageView];
}

@end
